VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "msmask32.ocx"
Begin VB.Form frmAgregarOtrosIngre 
   BackColor       =   &H00004040&
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   2655
   ClientLeft      =   15
   ClientTop       =   15
   ClientWidth     =   7605
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   2655
   ScaleWidth      =   7605
   StartUpPosition =   2  'CenterScreen
   Begin VB.TextBox txtCorre 
      Height          =   285
      Left            =   360
      TabIndex        =   10
      Text            =   "Text1"
      Top             =   3120
      Width           =   1215
   End
   Begin VB.TextBox txtNombre 
      Height          =   360
      Left            =   2280
      TabIndex        =   3
      Top             =   1920
      Width           =   3495
   End
   Begin VB.CommandButton CmdSalir 
      BackColor       =   &H0080C0FF&
      Caption         =   "Salir"
      Height          =   375
      Left            =   6000
      MouseIcon       =   "frmAgregarOtrosIngre.frx":0000
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   1920
      Width           =   1335
   End
   Begin MSDataListLib.DataCombo cboEmpresa 
      Bindings        =   "frmAgregarOtrosIngre.frx":030A
      Height          =   315
      Left            =   240
      TabIndex        =   0
      Top             =   480
      Width           =   7095
      _ExtentX        =   12515
      _ExtentY        =   556
      _Version        =   393216
      Appearance      =   0
      ListField       =   "rNomEmpresa"
      BoundColumn     =   "tNumEmpresa"
      Text            =   ""
      Object.DataMember      =   "cempresa"
   End
   Begin MSMask.MaskEdBox mskCuenta 
      Height          =   360
      Left            =   240
      TabIndex        =   2
      Top             =   1920
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   635
      _Version        =   393216
      Appearance      =   0
      MaxLength       =   14
      Mask            =   "#-#-#-##-##-##"
      PromptChar      =   "_"
   End
   Begin MSDataListLib.DataCombo cboTipoPlanilla 
      Bindings        =   "frmAgregarOtrosIngre.frx":031B
      Height          =   315
      Left            =   240
      TabIndex        =   1
      Top             =   1200
      Width           =   7095
      _ExtentX        =   12515
      _ExtentY        =   556
      _Version        =   393216
      Appearance      =   0
      BackColor       =   16777215
      ListField       =   "vDescripcion_TipoPlanilla"
      BoundColumn     =   "iCodigo_TipoPlanilla"
      Text            =   ""
      Object.DataMember      =   "plaCTipoPlanilla"
   End
   Begin VB.Label Label5 
      BackColor       =   &H00E0E0E0&
      BackStyle       =   0  'Transparent
      Caption         =   "Tipo de Planilla"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   240
      TabIndex        =   9
      Top             =   960
      Width           =   1695
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "Cuenta"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   240
      TabIndex        =   8
      Top             =   1680
      Width           =   1215
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "Descripcion"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   2280
      TabIndex        =   7
      Top             =   1680
      Width           =   1215
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   375
      Left            =   120
      TabIndex        =   6
      Top             =   240
      Width           =   2415
   End
   Begin VB.Label Label2 
      BackColor       =   &H00004040&
      Caption         =   "Empresa"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   240
      TabIndex        =   5
      Top             =   240
      Width           =   2055
   End
End
Attribute VB_Name = "frmAgregarOtrosIngre"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cboEmpleados_KeyDown(KeyCode As Integer, Shift As Integer)
HacerTab KeyCode
End Sub

Private Sub cboEmpresa_KeyDown(KeyCode As Integer, Shift As Integer)
HacerTab KeyCode
End Sub

Private Sub cboTipoPlanilla_KeyDown(KeyCode As Integer, Shift As Integer)
HacerTab KeyCode
End Sub

Private Sub CmdSalir_Click()
    On Error GoTo Errores
    Set rscuenta = New ADODB.Recordset

        Dim Confirmar As Integer
        Confirmar = MsgBox("Desea Guardar los datos?", vbYesNo + vbQuestion + vbDefaultButton2)
        If Confirmar = vbYes Then
                    
            'verifico que Exista la cuenta para las  Hora extras
            If Me.mskCuenta.Text <> "_-_-_-__-__-__" Then
                   rscuenta.Open "Select * from SACF_contpresupuesto..cypCatalogoCuenta where (tNumEmpresa=" & Me.cboEmpresa.BoundText & ") and (cNumCuenta='" & Me.mskCuenta.Text & "')", DE.Cnn, adOpenDynamic, adLockReadOnly
                   If rscuenta.RecordCount <> 0 Then
                      existecuenta = True
                   Else
                      existecuenta = False
                   End If
                   
                   If existecuenta = False Then
                    MsgBox "No existe este numero de cuenta para esta empresa"
                    Exit Sub
                   End If
                   rscuenta.Close
            End If
            If txtNombre.Text = "" Then
                MsgBox "La descripcion es obligatoria"
                Exit Sub
            End If
            
            If Me.cboEmpresa.Text = "" Then
                MsgBox "La Empresa es obligatoria"
                Exit Sub
            End If
            
            If cboTipoPlanilla.Text = "" Then
                MsgBox "El tipo de planilla es obligatoria"
                Exit Sub
            End If
            
           
            DE.MCuentasContablesOtrosIn Accion, Val(Me.txtCorre.Text), Me.cboEmpresa.BoundText, Me.mskCuenta.Text, cboTipoPlanilla.BoundText, (UCase(Me.txtNombre.Text))
        
    
            
        End If
        Unload Me
   

Exit Sub
Errores:
    
    MsgBox "Esta asignacion ya se realizo"
End Sub


Private Sub Form_Load()
    If Accion = "U" Then
        MostrarRegistro
    End If
   
End Sub

Private Sub mskCuenta_KeyDown(KeyCode As Integer, Shift As Integer)
HacerTab KeyCode
End Sub

Private Sub txtNombre_KeyDown(KeyCode As Integer, Shift As Integer)
HacerTab KeyCode
End Sub
Private Sub MostrarRegistro()
    On Error Resume Next
    '' este es tipo de planilla

    If DE.rsPKCuentasContablesOtrosIn.State = adStateOpen Then DE.rsPKCuentasContablesOtrosIn.Close
    DE.PKCuentasContablesOtrosIn pp, Empresa, Cuenta, ElReporte
    
    With DE.rsPKCuentasContablesOtrosIn
        If Not .EOF Then
            Me.cboEmpresa.BoundText = .Fields("Empresa")
            Me.mskCuenta.Text = .Fields("cuenta")
            Me.txtNombre.Text = .Fields("nombre")
            Me.cboTipoPlanilla.BoundText = .Fields("TipoPlanilla")
            Me.txtCorre.Text = .Fields("Corre")
       End If

       
    End With
Exit Sub
'Errores:
'    Errores Err, Error

End Sub
